

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>监控概览 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../genindex/" />
    <link rel="search" title="Search" href="../search/" />
    <link rel="next" title="API 文档" href="../api/" />
    <link rel="prev" title="CLI API Commands Module" href="../mgr/cli_api/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">监控概览</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/monitoring/index.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">监控概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#ceph">Ceph 监控栈</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">Ceph 指标</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">Ceph 守护进程健康指标</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">性能指标</a></li>
<li class="toctree-l2"><a class="reference internal" href="#osd">OSD 性能</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">物理磁盘性能</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id6">存储池指标</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id7">对象指标</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id8">通用指标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#get">GET 操作：相关的指标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#put">PUT 操作：相关的指标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id9">有用的查询</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id10">文件系统指标</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id11">主要指标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id12">有用的查询</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id13">块设备指标</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id14">主要指标</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id15">有用的查询</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id16">硬件监控</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="monitoring">
<span id="id1"></span><h1>监控概览<a class="headerlink" href="#monitoring" title="Permalink to this heading"></a></h1>
<p>这部分文档的目的是解释 Ceph 监控栈和主要 Ceph 指标的含义。</p>
<p>充分了解 Ceph 监控堆栈和指标后，用户就能创建定制的监控工具，
如 Prometheus 查询、 Grafana 面板或脚本。</p>
<section id="ceph">
<h2>Ceph 监控栈<a class="headerlink" href="#ceph" title="Permalink to this heading"></a></h2>
<p>Ceph 提供了默认的监控堆栈，是由 cephadm 安装、并在 cephadm 文档的
<a class="reference internal" href="../cephadm/services/monitoring/#mgr-cephadm-monitoring"><span class="std std-ref">监控服务</span></a> 部分进行了说明。</p>
</section>
<section id="id2">
<h2>Ceph 指标<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>Ceph 指标的主要来源是每个 Ceph 守护进程暴露的性能计数器。
<a class="reference internal" href="../dev/perf_counters/"><span class="doc">性能计数器</span></a> 是原生的 Ceph 监控数据。</p>
<p>性能计数器由 Ceph exporter （导出器）守护进程转换为标准 Prometheus 指标。
这样的守护进程运行在每个 Ceph 集群主机上，并暴露一个指标端点（ end point ），
在该端点上，主机上运行的所有 Ceph 守护进程公开的所有性能计数器都以 Prometheus 指标的格式发布。</p>
<p>除了 Ceph exporter 外，还有另一个代理可以暴露 Ceph 指标。
它就是 Prometheus 管理器模块，用于公开与整个集群相关的指标，
基本上是单个 Ceph 守护进程不能生成的指标。</p>
<p>获取 Ceph 指标的主要来源是集群 Prometheus 服务器暴露的指标端点。
Ceph 给你提供了 Prometheus 端点，你可以从该端点获取完整的指标列表
（来自 Ceph exporter 守护进程和 Prometheus 管理器模块）并执行查询。</p>
<p>要获取集群中的 Prometheus 服务器端点，执行下列命令：</p>
<p>例如：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># ceph orch ps --service_name prometheus</span>
NAME<span class="w">                         </span>HOST<span class="w">                          </span>PORTS<span class="w">   </span>STATUS<span class="w">          </span>REFRESHED<span class="w">  </span>AGE<span class="w">  </span>MEM<span class="w"> </span>USE<span class="w">  </span>MEM<span class="w"> </span>LIM<span class="w">  </span>VERSION<span class="w">  </span>IMAGE<span class="w"> </span>ID<span class="w">      </span>CONTAINER<span class="w"> </span>ID
prometheus.cephtest-node-00<span class="w">  </span>cephtest-node-00.cephlab.com<span class="w">  </span>*:9095<span class="w">  </span>running<span class="w"> </span><span class="o">(</span>103m<span class="o">)</span><span class="w">    </span>50s<span class="w"> </span>ago<span class="w">   </span>5w<span class="w">     </span>142M<span class="w">        </span>-<span class="w">  </span><span class="m">2</span>.33.4<span class="w">   </span>514e6a882f6e<span class="w">  </span>efe3cbc2e521
</pre></div>
</div>
<p>有了这些信息，你就可以连接 <code class="docutils literal notranslate"><span class="pre">http://cephtest-node-00.cephlab.com:9095</span></code> ，
访问 Prometheus 服务器界面。</p>
<p>集群的完整指标列表（附带帮助）将可以在下列文件中看到：</p>
<p><code class="docutils literal notranslate"><span class="pre">http://cephtest-node-00.cephlab.com:9095/api/v1/targets/metadata</span></code></p>
<p>需要说明的是，用户观察和监控 Ceph 集群的主要工具是 <strong>Ceph dashboard</strong> 。它提供的图形界面能展示最重要的集群和服务指标。本文档中的大多数示例都是从仪表盘（ dashboard ）图例中提取或从 Ceph 仪表板展示的指标中推断出来的。</p>
</section>
<section id="id3">
<h2>Ceph 守护进程健康指标<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<p>Ceph exporter 提供了一个名为 <code class="docutils literal notranslate"><span class="pre">ceph_daemon_socket_up</span></code> 的指标，用于报告暴露管理套接字的各个 Ceph 守护进程的存活状态。</p>
<p><code class="docutils literal notranslate"><span class="pre">ceph_daemon_socket_up</span></code> 指标反映着 Ceph 守护进程的健康状态，是基于它通过管理套接字做出响应的能力，值为 <code class="docutils literal notranslate"><span class="pre">1</span></code> 表示健康， <code class="docutils literal notranslate"><span class="pre">0</span></code> 表示不健康。虽然 Ceph 守护进程报告 <code class="docutils literal notranslate"><span class="pre">ceph_daemon_socket_up=0</span></code> 的时候可能仍然“活着（ alive ）”，但这种情况凸显了其功能中的重大问题。正因如此，这个指标成了探测所有主要 Ceph 守护进程问题的绝佳工具。</p>
<p>标签：
- <strong>``ceph_daemon``</strong>: Ceph 守护进程标识符，它会在主机上暴露管理套接字（ admin socket ）。
- <strong>``hostname``</strong>: Ceph 守护进程所在主机的名字。</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_daemon_socket_up<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;mds.a&quot;</span>,hostname<span class="o">=</span><span class="s2">&quot;testhost&quot;</span><span class="o">}</span><span class="w"> </span><span class="m">1</span>
ceph_daemon_socket_up<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.1&quot;</span>,hostname<span class="o">=</span><span class="s2">&quot;testhost&quot;</span><span class="o">}</span><span class="w"> </span><span class="m">0</span>
</pre></div>
</div>
<p>要找出过去 12 小时内没有响应的所有 Ceph 守护进程，可用下列 PromQL 表达式：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">ceph_daemon_socket_up</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="m">0</span><span class="w"> </span>or<span class="w"> </span>min_over_time<span class="o">(</span>ceph_daemon_socket_up<span class="o">[</span>12h<span class="o">])</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="m">0</span>
</pre></div>
</div>
</section>
<section id="id4">
<h2>性能指标<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h2>
<p>用于衡量集群 Ceph 性能的主要指标：</p>
<p>所有指标都有下列标签：
<code class="docutils literal notranslate"><span class="pre">ceph_daemon</span></code> ：产生指标的 OSD 守护进程的标识符
<code class="docutils literal notranslate"><span class="pre">instance</span></code> ：暴露度量指标的 ceph exporter 实例的 IP 地址。
<code class="docutils literal notranslate"><span class="pre">job</span></code> ： prometheus 扫描作业</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_osd_op_r<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span>,<span class="w"> </span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;192.168.122.7:9283&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span><span class="o">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">73981</span>
</pre></div>
</div>
<p><em>集群 I/O （吞吐量）：</em>
用 <code class="docutils literal notranslate"><span class="pre">ceph_osd_op_r_out_bytes</span></code> 和 <code class="docutils literal notranslate"><span class="pre">ceph_osd_op_w_in_bytes</span></code> 获取客户端产生的集群吞吐量</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>Writes<span class="w"> </span><span class="o">(</span>B/s<span class="o">)</span>:
sum<span class="o">(</span>irate<span class="o">(</span>ceph_osd_op_w_in_bytes<span class="o">[</span>1m<span class="o">]))</span>

Reads<span class="w"> </span><span class="o">(</span>B/s<span class="o">)</span>:
sum<span class="o">(</span>irate<span class="o">(</span>ceph_osd_op_r_out_bytes<span class="o">[</span>1m<span class="o">]))</span>
</pre></div>
</div>
<p><em>集群 I/O （操作）：</em>
用 <code class="docutils literal notranslate"><span class="pre">ceph_osd_op_r</span></code> 、 <code class="docutils literal notranslate"><span class="pre">ceph_osd_op_w</span></code> 获取客户端产生的操作数量</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>Writes<span class="w"> </span><span class="o">(</span>ops/s<span class="o">)</span>:
sum<span class="o">(</span>irate<span class="o">(</span>ceph_osd_op_w<span class="o">[</span>1m<span class="o">]))</span>

Reads<span class="w"> </span><span class="o">(</span>ops/s<span class="o">)</span>:
sum<span class="o">(</span>irate<span class="o">(</span>ceph_osd_op_r<span class="o">[</span>1m<span class="o">]))</span>
</pre></div>
</div>
<p><em>延迟：</em>
用 <code class="docutils literal notranslate"><span class="pre">ceph_osd_op_latency_sum</span></code> ，它表示在客户端发出数据传输指令后、 OSD 开始传输数据前的延迟时间。</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sum<span class="o">(</span>irate<span class="o">(</span>ceph_osd_op_latency_sum<span class="o">[</span>1m<span class="o">]))</span>
</pre></div>
</div>
</section>
<section id="osd">
<h2>OSD 性能<a class="headerlink" href="#osd" title="Permalink to this heading"></a></h2>
<p>前面介绍的集群性能指标是基于 OSD 指标的，选择正确的标签，我们就可以为单个 OSD 获取到与集群性能指标相当的信息：</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>OSD<span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="nb">read</span><span class="w"> </span>latency
irate<span class="o">(</span>ceph_osd_op_r_latency_sum<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}[</span>1m<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>irate<span class="o">(</span>ceph_osd_op_r_latency_count<span class="o">[</span>1m<span class="o">])</span>

OSD<span class="w"> </span><span class="m">0</span><span class="w"> </span>write<span class="w"> </span>IOPS
irate<span class="o">(</span>ceph_osd_op_w<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}[</span>1m<span class="o">])</span>

OSD<span class="w"> </span><span class="m">0</span><span class="w"> </span>write<span class="w"> </span>thughtput<span class="w"> </span><span class="o">(</span>bytes<span class="o">)</span>
irate<span class="o">(</span>ceph_osd_op_w_in_bytes<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}[</span>1m<span class="o">])</span>

OSD.0<span class="w"> </span>total<span class="w"> </span>raw<span class="w"> </span>capacity<span class="w"> </span>available
ceph_osd_stat_bytes<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span>,<span class="w"> </span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;cephtest-node-00.cephlab.com:9283&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span><span class="o">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">536451481</span>
</pre></div>
</div>
</section>
<section id="id5">
<h2>物理磁盘性能<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h2>
<p>将 Prometheus <code class="docutils literal notranslate"><span class="pre">node_exporter</span></code> 指标与 Ceph 指标相结合，
我们就能获得 OSD 所用物理磁盘提供的性能信息。</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>OSD<span class="w"> </span><span class="m">0</span><span class="w"> </span>所用设备的读延时:
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_read_time_seconds_total<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>irate<span class="o">(</span>node_disk_reads_completed_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

OSD<span class="w"> </span><span class="m">0</span><span class="w"> </span>所用设备的写延时：
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_write_time_seconds_total<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>irate<span class="o">(</span>node_disk_writes_completed_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

IOPS<span class="w"> </span><span class="o">(</span>OSD.0<span class="w"> </span>所用的设备<span class="o">)</span>
reads:
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_reads_completed_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

writes:
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_writes_completed_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

吞吐量<span class="w"> </span><span class="o">(</span>OSD.0<span class="w"> </span>所用的设备<span class="o">)</span>
reads:
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_read_bytes_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

writes:
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_written_bytes_total<span class="o">[</span>1m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>

过去<span class="w"> </span><span class="m">5</span><span class="w"> </span>分钟，<span class="w"> </span>OSD.0<span class="w"> </span>的物理设备利用率<span class="w"> </span><span class="o">(</span>%<span class="o">)</span>
label_replace<span class="o">(</span>irate<span class="o">(</span>node_disk_io_time_seconds_total<span class="o">[</span>5m<span class="o">])</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span><span class="w"> </span>and<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance,<span class="w"> </span>device<span class="o">)</span><span class="w"> </span>label_replace<span class="o">(</span>label_replace<span class="o">(</span>ceph_disk_occupation_human<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;osd.0&quot;</span><span class="o">}</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;device&quot;</span>,<span class="w"> </span><span class="s2">&quot;/dev/(.*)&quot;</span><span class="o">)</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span>,<span class="w"> </span><span class="s2">&quot;instance&quot;</span>,<span class="w"> </span><span class="s2">&quot;([^:.]*).*&quot;</span><span class="o">)</span>
</pre></div>
</div>
</section>
<section id="id6">
<h2>存储池指标<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<p>这些指标的标签如下：
<code class="docutils literal notranslate"><span class="pre">instance</span></code> ：生成度量指标的 Ceph 输出守护进程的 IP 地址。
<code class="docutils literal notranslate"><span class="pre">pool_id</span></code> ：池的标识符
<code class="docutils literal notranslate"><span class="pre">job</span></code> ：prometheus scrape （扫描）作业。</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_metadata</span></code>: 这个存储池的信息。它可与其他指标一起使用，就能在查询和图表中提供更多上下文信息。除这三个常用标签外，该指标还提供下列额外标签：</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">compression_mode</span></code>: 存储池中使用的压缩方式（ lz4、snappy、zlib、zstd、none）。
示例： compression_mode=”none”</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">description</span></code>: 存储池类型的简要说明（replica: 副本数或纠删码： ec profile ）。
例如： description=”replica:3”</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">name</span></code>: 存储池名字，实例： name=”.mgr”</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">type</span></code>: 存储池类型 (replicated/erasure code) 。实例： type=”replicated”</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_bytes_used</span></code>: 用户数据消耗的原始总容量以及相关的存储池开销（元数据 + 冗余）：</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_stored</span></code>: 存储池内的<strong>客户端</strong>数据总数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_compress_under_bytes</span></code>: 存储池内符合压缩条件的数据</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_compress_bytes_used</span></code>:  存储池内已压缩的数据</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_rd</span></code>: 每个存储池的<strong>客户端</strong>读操作（每秒读取数量）</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_rd_bytes</span></code>: 每个存储池的<strong>客户端</strong>读操作字节数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_wr</span></code>: 每个存储池的<strong>客户端</strong>写操作（每秒写入数量）</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_pool_wr_bytes</span></code>: 每个存储池的<strong>客户端</strong>写操作字节数</p></li>
</ul>
<p><strong>有用的查询</strong>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>整个集群的可用原始容量：
sum<span class="o">(</span>ceph_osd_stat_bytes<span class="o">)</span>

整个集群用掉的原始容量（包括元数据、冗余）：
sum<span class="o">(</span>ceph_pool_bytes_used<span class="o">)</span>

集群内存储的客户端数据总量：
sum<span class="o">(</span>ceph_pool_stored<span class="o">)</span>

压缩节约的：
sum<span class="o">(</span>ceph_pool_compress_under_bytes<span class="w"> </span>-<span class="w"> </span>ceph_pool_compress_bytes_used<span class="o">)</span>

一个存储池（<span class="w"> </span>testrbdpool<span class="w"> </span>）的客户端<span class="w"> </span>IOPS
reads:<span class="w"> </span>irate<span class="o">(</span>ceph_pool_rd<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="o">(</span>pool_id<span class="o">)</span><span class="w"> </span>group_left<span class="o">(</span>instance,name<span class="o">)</span><span class="w"> </span>ceph_pool_metadata<span class="o">{</span><span class="nv">name</span><span class="o">=</span>~<span class="s2">&quot;testrbdpool&quot;</span><span class="o">}</span>
writes:<span class="w"> </span>irate<span class="o">(</span>ceph_pool_wr<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="o">(</span>pool_id<span class="o">)</span><span class="w"> </span>group_left<span class="o">(</span>instance,name<span class="o">)</span><span class="w"> </span>ceph_pool_metadata<span class="o">{</span><span class="nv">name</span><span class="o">=</span>~<span class="s2">&quot;testrbdpool&quot;</span><span class="o">}</span>

一个存储池的客户端吞吐量：
reads:<span class="w"> </span>irate<span class="o">(</span>ceph_pool_rd_bytes<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="o">(</span>pool_id<span class="o">)</span><span class="w"> </span>group_left<span class="o">(</span>instance,name<span class="o">)</span><span class="w"> </span>ceph_pool_metadata<span class="o">{</span><span class="nv">name</span><span class="o">=</span>~<span class="s2">&quot;testrbdpool&quot;</span><span class="o">}</span>
writes:<span class="w"> </span>irate<span class="o">(</span>ceph_pool_wr_bytes<span class="o">[</span>1m<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="o">(</span>pool_id<span class="o">)</span><span class="w"> </span>group_left<span class="o">(</span>instance,name<span class="o">)</span><span class="w"> </span>ceph_pool_metadata<span class="o">{</span><span class="nv">name</span><span class="o">=</span>~<span class="s2">&quot;testrbdpool&quot;</span><span class="o">}</span>
</pre></div>
</div>
</section>
<section id="id7">
<h2>对象指标<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h2>
<p>这些指标的标签如下：
<code class="docutils literal notranslate"><span class="pre">instance</span></code>: 提供指标的 ceph exporter 守护进程的 IP 地址
<code class="docutils literal notranslate"><span class="pre">instance_id</span></code>: rgw 守护进程的标识符
<code class="docutils literal notranslate"><span class="pre">job</span></code>: prometheus scrape （扫描）作业</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_rgw_req<span class="o">{</span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;192.168.122.7:9283&quot;</span>,<span class="w"> </span><span class="nv">instance_id</span><span class="o">=</span><span class="s2">&quot;154247&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span><span class="o">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">12345</span>
</pre></div>
</div>
<section id="id8">
<h3>通用指标<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_metadata</span></code>: 提供 RGW 守护进程的通用信息。它可与其他指标一起使用，
以便在查询和图表中提供更多上下文信息。除这三个通用标签外，该指标还提供下列额外标签：</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_daemon</span></code>: Ceph 守护进程名字。实例：
ceph_daemon=”rgw.rgwtest.cephtest-node-00.sxizyq”,</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_version</span></code>: Ceph 守护进程版本。实例： ceph_version=”ceph
version 17.2.6 (d7ff0d10654d2280e08f1ab989c7cdf3064446a5) quincy (stable)” 。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span></code>: 此守护进程所在主机的名字。实例：
hostname:”cephtest-node-00.cephlab.com” 。</p></li>
</ul>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">ceph_rgw_req</span></code>: 此守护进程处理的请求总数（ GET+PUT+DELETE ）</dt><dd><p>探测瓶颈和优化负载分布时有用。</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">ceph_rgw_qlen</span></code>: 此守护进程的 RGW 操作队列长度。</dt><dd><p>探测瓶颈和优化负载分布时有用。</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">ceph_rgw_failed_req</span></code>: 中止的请求。</dt><dd><p>探测守护进程错误时有用。</p>
</dd>
</dl>
</li>
</ul>
</section>
<section id="get">
<h3>GET 操作：相关的指标<a class="headerlink" href="#get" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_get_initial_lat_count</span></code>: GET 操作数量</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_get_initial_lat_sum</span></code>: GET 操作的总延时</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_get</span></code>: GET 请求总数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_get_b</span></code>: GET 操作传输的总字节数</p></li>
</ul>
</section>
<section id="put">
<h3>PUT 操作：相关的指标<a class="headerlink" href="#put" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_put_initial_lat_count</span></code>: PUT 操作数量</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_put_initial_lat_sum</span></code>: PUT 操作的总延时</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_put</span></code>: PUT 操作的总数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rgw_get_b</span></code>: PUT 操作传输的总字节数</p></li>
</ul>
</section>
<section id="id9">
<h3>有用的查询<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>GET<span class="w"> </span>的平均延时：
rate<span class="o">(</span>ceph_rgw_get_initial_lat_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>rate<span class="o">(</span>ceph_rgw_get_initial_lat_count<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

PUT<span class="w"> </span>的平均延时：
rate<span class="o">(</span>ceph_rgw_put_initial_lat_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>rate<span class="o">(</span>ceph_rgw_put_initial_lat_count<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

每秒请求总数：
rate<span class="o">(</span>ceph_rgw_req<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

“其他”操作（<span class="w"> </span>LIST<span class="w"> </span>、<span class="w"> </span>DELETE<span class="w"> </span>）的总数
rate<span class="o">(</span>ceph_rgw_req<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>-<span class="w">  </span><span class="o">(</span>rate<span class="o">(</span>ceph_rgw_get<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>+<span class="w"> </span>rate<span class="o">(</span>ceph_rgw_put<span class="o">[</span>30s<span class="o">]))</span>

GET<span class="w"> </span>延时
rate<span class="o">(</span>ceph_rgw_get_initial_lat_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w">  </span>rate<span class="o">(</span>ceph_rgw_get_initial_lat_count<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

PUT<span class="w"> </span>延时
rate<span class="o">(</span>ceph_rgw_put_initial_lat_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w">  </span>rate<span class="o">(</span>ceph_rgw_put_initial_lat_count<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

GET<span class="w"> </span>操作消耗的带宽
sum<span class="o">(</span>rate<span class="o">(</span>ceph_rgw_get_b<span class="o">[</span>30s<span class="o">]))</span>

PUT<span class="w"> </span>操作消耗的带宽
sum<span class="o">(</span>rate<span class="o">(</span>ceph_rgw_put_b<span class="o">[</span>30s<span class="o">]))</span>

RGW<span class="w"> </span>例程消耗的带宽（<span class="w"> </span>PUT<span class="w"> </span>、<span class="w"> </span>GET<span class="w"> </span>操作）
sum<span class="w"> </span>by<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span><span class="o">(</span>rate<span class="o">(</span>ceph_rgw_get_b<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>+<span class="w"> </span>rate<span class="o">(</span>ceph_rgw_put_b<span class="o">[</span>30s<span class="o">]))</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance_id<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata

Http<span class="w"> </span>错误:
rate<span class="o">(</span>ceph_rgw_failed_req<span class="o">[</span>30s<span class="o">])</span>
</pre></div>
</div>
</section>
</section>
<section id="id10">
<h2>文件系统指标<a class="headerlink" href="#id10" title="Permalink to this heading"></a></h2>
<p>这些指标的标签如下：
<code class="docutils literal notranslate"><span class="pre">ceph_daemon</span></code>: MDS 守护进程的名字。
<code class="docutils literal notranslate"><span class="pre">instance</span></code>: 暴露指标的 ceph exporter 守护进程的 IP 地址（和端口）。
<code class="docutils literal notranslate"><span class="pre">job</span></code>: prometheus scrape （扫描）作业</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_mds_request<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;mds.test.cephtest-node-00.hmhsoh&quot;</span>,<span class="w"> </span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;192.168.122.7:9283&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span><span class="o">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">1452</span>
</pre></div>
</div>
<section id="id11">
<h3>主要指标<a class="headerlink" href="#id11" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_metadata</span></code>: 提供 MDS 守护进程的一般信息。它可与其他指标一起使用，
以便在查询和图表中提供更多上下文信息。它提供下列额外标签：</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_version</span></code>: MDS 守护进程的 Ceph 版本</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">fs_id</span></code>: 文件系统集群 id （ fscid ）</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span></code>: MDS 守护进程所在主机的名字</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">public_addr</span></code>: MDS 守护进程所用的公网地址（ public address ）</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">rank</span></code>: 这个 MDS 守护进程的 rank</p></li>
</ul>
</li>
</ul>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_mds_metadata<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;mds.test.cephtest-node-00.hmhsoh&quot;</span>,<span class="w"> </span><span class="nv">ceph_version</span><span class="o">=</span><span class="s2">&quot;ceph version 17.2.6 (d7ff0d10654d2280e08f1ab989c7cdf3064446a5) quincy (stable)&quot;</span>,<span class="w"> </span><span class="nv">fs_id</span><span class="o">=</span><span class="s2">&quot;-1&quot;</span>,<span class="w"> </span><span class="nv">hostname</span><span class="o">=</span><span class="s2">&quot;cephtest-node-00.cephlab.com&quot;</span>,<span class="w"> </span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;cephtest-node-00.cephlab.com:9283&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span>,<span class="w"> </span><span class="nv">public_addr</span><span class="o">=</span><span class="s2">&quot;192.168.122.145:6801/118896446&quot;</span>,<span class="w"> </span><span class="nv">rank</span><span class="o">=</span><span class="s2">&quot;-1&quot;</span><span class="o">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_request</span></code>: 这个 MDS 守护进程处理的请求总数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_reply_latency_sum</span></code>: 响应延时总计</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_reply_latency_count</span></code>: 响应延时计数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_server_handle_client_request</span></code>: 客户端请求数量</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_sessions_session_count</span></code>: 会话计数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_sessions_total_load</span></code>: 总负载</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_sessions_sessions_open</span></code>: 当前打开着的会话</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_sessions_sessions_stale</span></code>: 当前过期的会话</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_objecter_op_r</span></code>: 读操作数量</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_objecter_op_w</span></code>: 写操作数量</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_root_rbytes</span></code>: 此守护进程管理的总字节数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_mds_root_rfiles</span></code>: 此守护进程管理的文件总数</p></li>
</ul>
</section>
<section id="id12">
<h3>有用的查询<a class="headerlink" href="#id12" title="Permalink to this heading"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>MDS<span class="w"> </span>守护进程们的读出载荷总计：
sum<span class="o">(</span>rate<span class="o">(</span>ceph_objecter_op_r<span class="o">[</span>1m<span class="o">]))</span>

MDS<span class="w"> </span>守护进程们的写入载荷总计：
sum<span class="o">(</span>rate<span class="o">(</span>ceph_objecter_op_w<span class="o">[</span>1m<span class="o">]))</span>

MDS<span class="w"> </span>守护进程读载荷：（守护进程名为<span class="w"> </span>mdstest<span class="w"> </span>）
sum<span class="o">(</span>rate<span class="o">(</span>ceph_objecter_op_r<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;mdstest&quot;</span><span class="o">}[</span>1m<span class="o">]))</span>

MDS<span class="w"> </span>守护进程写入载荷：（守护进程名为<span class="w"> </span>mdstest<span class="w"> </span>）
sum<span class="o">(</span>rate<span class="o">(</span>ceph_objecter_op_r<span class="o">{</span><span class="nv">ceph_daemon</span><span class="o">=</span>~<span class="s2">&quot;mdstest&quot;</span><span class="o">}[</span>1m<span class="o">]))</span>

响应的平均延时：
rate<span class="o">(</span>ceph_mds_reply_latency_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>rate<span class="o">(</span>ceph_mds_reply_latency_count<span class="o">[</span>30s<span class="o">])</span>

每秒的总请求数：
rate<span class="o">(</span>ceph_mds_request<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance<span class="o">)</span><span class="w"> </span>group_right<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_mds_metadata
</pre></div>
</div>
</section>
</section>
<section id="id13">
<h2>块设备指标<a class="headerlink" href="#id13" title="Permalink to this heading"></a></h2>
<p>默认不提供映像的 RBD 指标，是为了 prometheus 管理器模块能达到最佳性能。</p>
<p>要生成 RBD 映像的指标，需要正确配置管理器选项 <code class="docutils literal notranslate"><span class="pre">mgr/prometheus/rbd_stats_pools</span></code> 。
更多信息参阅 <a class="reference internal" href="../mgr/prometheus/#prometheus-rbd-io-statistics"><span class="std std-ref">Ceph 健康检查</span></a> 。</p>
<p>这些指标的标签如下：
<code class="docutils literal notranslate"><span class="pre">image</span></code>: 产生指标数值的映像的名字。
<code class="docutils literal notranslate"><span class="pre">instance</span></code>: 产生这个 RBD 指标的节点（也就是 Ceph exporter 守护进程）
<code class="docutils literal notranslate"><span class="pre">job</span></code>: Prometheus scrape （扫描）作业的名字。
<code class="docutils literal notranslate"><span class="pre">pool</span></code>: 映像存储池名字。</p>
<p>实例：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ceph_rbd_read_bytes<span class="o">{</span><span class="nv">image</span><span class="o">=</span><span class="s2">&quot;test2&quot;</span>,<span class="w"> </span><span class="nv">instance</span><span class="o">=</span><span class="s2">&quot;cephtest-node-00.cephlab.com:9283&quot;</span>,<span class="w"> </span><span class="nv">job</span><span class="o">=</span><span class="s2">&quot;ceph&quot;</span>,<span class="w"> </span><span class="nv">pool</span><span class="o">=</span><span class="s2">&quot;testrbdpool&quot;</span><span class="o">}</span>
</pre></div>
</div>
<section id="id14">
<h3>主要指标<a class="headerlink" href="#id14" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_read_bytes</span></code>: RBD 映像的读字节数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_read_latency_count</span></code>: RBD 映像的读延时计数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_read_latency_sum</span></code>: RBD 映像的读延时总计</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_read_ops</span></code>: RBD 映像的读取计数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_write_bytes</span></code>: RBD 映像的写入字节数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_write_latency_count</span></code>: RBD 映像的写延时计数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_write_latency_sum</span></code>: RBD 映像的写延时总计</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_rbd_write_ops</span></code>: RBD 映像的写入计数</p></li>
</ul>
</section>
<section id="id15">
<h3>有用的查询<a class="headerlink" href="#id15" title="Permalink to this heading"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>读延时平均值：
rate<span class="o">(</span>ceph_rbd_read_latency_sum<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>/<span class="w"> </span>rate<span class="o">(</span>ceph_rbd_read_latency_count<span class="o">[</span>30s<span class="o">])</span><span class="w"> </span>*<span class="w"> </span>on<span class="w"> </span><span class="o">(</span>instance<span class="o">)</span><span class="w"> </span>group_left<span class="w"> </span><span class="o">(</span>ceph_daemon<span class="o">)</span><span class="w"> </span>ceph_rgw_metadata
</pre></div>
</div>
</section>
</section>
<section id="id16">
<h2>硬件监控<a class="headerlink" href="#id16" title="Permalink to this heading"></a></h2>
<p>见 <a class="reference internal" href="../hardware-monitoring/#hardware-monitoring"><span class="std std-ref">硬件监控</span></a> 。</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../mgr/cli_api/" class="btn btn-neutral float-left" title="CLI API Commands Module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../api/" class="btn btn-neutral float-right" title="API 文档" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>